package com.huey.utils.thread.study.ThreadPool;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import static java.util.concurrent.Executors.*;

/**
 * 描述：     永远一个线程
 */
public class SingleThreadExecutor {
    public static void main(String[] args) {
        ExecutorService executorService = newSingleThreadExecutor();
        for (int i = 0; i < 1000; i++) {
            executorService.execute(new Task());
        }
    }
}
